﻿using System.Collections.Generic;
using Aquarinum.WebSocekt.Core.Dtos;

namespace Aquarinum.Base.Infrastructure.WebSocket.Interface
{
    public interface IMessageCacheHandler
    {
        /// <summary>
        ///     保存信息
        /// </summary>
        /// <param name="socketMessage"></param>
        /// ///
        /// <param name="expireSecond">消息过期时间(单位秒)</param>
        void SaveMessage(WebsocketMessageDto socketMessage, long expireSecond);

        /// <summary>
        ///     获取信息
        /// </summary>
        IList<WebsocketMessageDto> GetMessage();


        /// <summary>
        ///     获取信息
        /// </summary>
        /// <param name="toCliet"></param>
        IList<WebsocketMessageDto> GetMessageByToClient(string toCliet);


        /// <summary>
        ///     判断消息是否过期
        /// </summary>
        /// <returns></returns>
        bool CheckMessageHasExpire();
    }
}